package com.pig4cloud.pigx.contract.mapstruct;

import com.pig4cloud.pigx.contract.bo.ContractOrderNewBO;
import com.pig4cloud.pigx.contract.dto.ContractOrderCloseDTO;
import com.pig4cloud.pigx.contract.dto.ContractOrderNewDTO;
import com.pig4cloud.pigx.contract.dto.ContractOrderOpenDTO;
import com.pig4cloud.pigx.contract.dto.ContractRobotPlaceOrderDTO;
import com.pig4cloud.pigx.contract.entity.ContractOrder;
import com.pig4cloud.pigx.contract.mongo.entity.ContractOrderMongo;
import com.pig4cloud.pigx.contract.open.api.vo.OpenApiOrderVOV1;
import com.pig4cloud.pigx.contract.vo.ContractOrderVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ContractOrderStruct
 *
 * @date 2022/8/12 16:32
 */
@Mapper
public interface ContractOrderStruct {
    ContractOrderStruct INSTANCE = Mappers.getMapper(ContractOrderStruct.class);

    /**
     * 将实体类转换为vo
     *
     * @param entity 实体类
     * @return {@link ContractOrderVO}
     * @date 2022/2/8
     * @since 1.0.0
     */
    @Mappings({})
    ContractOrderVO entity2Vo(ContractOrder entity);

    /**
     * list转换为voList
     *
     * @param list 实体类集合
     * @return {@link List<  ContractOrderVO >}
     * @date 2022/7/14 14:21
     */
    List<ContractOrderVO> list2Vo(List<ContractOrder> list);

    /**
     * 将实体类转换为mongo
     *
     * @param entity 实体类
     * @return {@link ContractOrderMongo}
     * @date 2022/2/8
     * @since 1.0.0
     */
    @Mappings({})
    ContractOrderMongo entity2Mongo(ContractOrder entity);

    /**
     * list转换为mongoList
     *
     * @param list 实体类集合
     * @return {@link List< ContractOrderMongo>}
     * @date 2022/7/14 14:21
     */
    List<ContractOrderMongo> list2Mongo(List<ContractOrder> list);

    /**
     * 将实体类转换为mongo
     *
     * @param mongo mongo
     * @return {@link ContractOrder}
     * @date 2022/2/8
     * @since 1.0.0
     */
    @Mappings({})
    ContractOrder mongo2Entity(ContractOrderMongo mongo);

    /**
     * list转换为mongoList
     *
     * @param mongo mongo
     * @return {@link List< ContractOrder>}
     * @date 2022/7/14 14:21
     */
    List<ContractOrder> mongo2List(List<ContractOrderMongo> mongo);

    /**
     * ContractOrderNewBO转换为entity
     *
     * @param dto dto
     * @return {@link ContractOrder}
     * @date 2022/7/14 14:21
     */
    ContractOrder orderNewBO2Entity(ContractOrderNewBO dto);

    /**
     * ContractOrderNewBO转换为mongo
     *
     * @param dto dto
     * @return {@link ContractOrderMongo}
     * @date 2022/7/14 14:21
     */
    ContractOrderMongo orderNewBO2Mongo(ContractOrderNewBO dto);

    /**
     * ContractOrderNewDTO -> ContractOrderNewBO
     *
     * @param dto dto
     * @return {@link ContractOrderNewBO}
     * @date 2022/7/14 14:21
     */
    ContractOrderNewBO orderNewDTO2OrderNewBO(ContractOrderNewDTO dto);

    /**
     * ContractOrderNewRobotKLineDTO -> ContractOrderNewDTO
     *
     * @param dto dto
     * @return {@link List<ContractOrderNewDTO>}
     * @date 2022/7/14 14:21
     */
    List<ContractOrderNewDTO> orderNewRobotKLineDTOList2OrderNewDTOList(List<ContractRobotPlaceOrderDTO> dto);

    /**
     * ContractOrderOpenDTO -> ContractOrderNewDTO
     *
     * @param dto dto
     * @return {@link ContractOrderNewDTO}
     * @date 2022/7/14 14:21
     */
    ContractOrderNewDTO openDTO2NewDTO(ContractOrderOpenDTO dto);

    /**
     * ContractOrderCloseDTO -> ContractOrderNewDTO
     *
     * @param dto dto
     * @return {@link ContractOrderNewDTO}
     * @date 2022/7/14 14:21
     */
    ContractOrderNewDTO closeDTO2NewDTO(ContractOrderCloseDTO dto);

    /**
     * ContractOrder -> OpenApiOrderVOV1
     *
     * @param entity entity
     * @return {@link OpenApiOrderVOV1}
     * @date 2022/7/14 14:21
     */
    OpenApiOrderVOV1 entity2ApiVOV1(ContractOrder entity);
}
